package com.mofang.powerdekorhelper.adapter;

import android.content.Context;

import com.mofang.powerdekorhelper.R;
import com.mofang.powerdekorhelper.base.recycleview.BaseRecycleViewAdapter;
import com.mofang.powerdekorhelper.base.recycleview.BaseViewHolder;
import com.mofang.powerdekorhelper.model.ActivityList;

import java.util.List;

/**
 * Created by luofei on 2017/8/26 0026.
 * 说明：
 */

public class ActivityListAdapter extends BaseRecycleViewAdapter {

    public ActivityListAdapter(List<?> data, Context mContext, int layoutId) {
        super(data, mContext, layoutId);
    }

    @Override
    protected <T> void convert(BaseViewHolder holder, T bean, int position) {
        ActivityList.Data data = (ActivityList.Data) bean;

        if (data.getName() != null) {
            holder.setText(R.id.activity_list_name, "活动名称：" + data.getName());
        }

        if (data.getImgurl() != null) {
            holder.setImage(R.id.activity_list_imv, data.getImgurl(), -1);
        }

        holder.itemView.setTag(data);
    }
}
